afad35dd4e8b6e3388e6345c4a853971e87650a2,platform/lang-impl/src/com/intellij/execution/console/RunIdeConsoleAction.java,RunIdeConsoleAction,getConsoleView,#Project#VirtualFile#ScriptEngine#,189

Before Change


  @NotNull
  private static ConsoleView getConsoleView(@NotNull Project project, @NotNull VirtualFile file, @NotNull ScriptEngine engine) {
    PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
    WeakReference<ConsoleView> ref = psiFile == null ? null : psiFile.getCopyableUserData(CONSOLE_VIEW_KEY);
    ConsoleView existing = ref == null ? null : ref.get();
    if (existing != null && !Disposer.isDisposed(existing)) return existing;
    ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();

After Change


  private static RunContentDescriptor getConsoleView(@NotNull Project project, @NotNull VirtualFile file, @NotNull ScriptEngine engine) {
    PsiFile psiFile = ObjectUtils.assertNotNull(PsiManager.getInstance(project).findFile(file));

    WeakReference<RunContentDescriptor> ref = psiFile.getCopyableUserData(DESCRIPTOR_KEY);
    RunContentDescriptor existing = ref == null ? null : ref.get();
    if (existing != null && existing.getExecutionConsole() != null) return existing;
    ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();